﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Presentation.Module.Setup.Interfaces.Views;
using Presentation.Module.Setup.Interfaces.ViewModels;
using Presentation.Module.Setup.Models;

namespace Presentation.Setup.Views
{
    /// <summary>
    /// Interaction logic for AddSkillView.xaml
    /// </summary>
    public partial class AddSkillView : UserControl, IAddSkillView
    {
        public AddSkillView(IAddSkillViewModel viewModel)
        {
            InitializeComponent();
            
            this.ViewModel = viewModel;

            this.DataContext = this.ViewModel;
            this.ViewModel.View = this;
        }

        public IAddSkillViewModel ViewModel { get; private set; }

        public event Shell.Interfaces.ViewExit ViewExit;

        public void AddSkill()
        {
            this.ViewModel.CurrentSkill = new Skill();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Exit();
        }

        public new void Exit()
        {
            if (this.ViewExit != null)
            {
                this.ViewExit.Invoke();
            }
        }
    }
}
